package com.group01.dto.User;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * @Description 用户登录传输对象DTO
 * @Author 翟玉龙
 * @Date 2024/6/21
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
@Accessors(chain = true)
public class UserLoginDTO {
    /**
     * 登录用户名
     */
    @NotNull
    @Pattern(regexp = "^\\S{3,16}$",message = "用户名长度为3~16位")
    private String username;

    /**
     * 登录密码
     */
    @Pattern(regexp = "^(?=.*\\d)(?=.*[A-z])[\\da-zA-Z]{6,18}$",message = "密码必须由6~18位数字和字母组成")
    private String password;

}
